package com.leyou.common.vo;

import com.leyou.common.enums.ExceptionEnum;
import lombok.Data;

/**
 * description: 异常结果实体类
 * @author 朱正磊
 * @date 2021-03-25 17:20:20
 */
@Data
public class ExceptionResult {

    private Integer status;
    private String message;
    private Long timestamp;

    public ExceptionResult() {}

    public ExceptionResult(ExceptionEnum em) {
        this.status = em.getCode();
        this.message = em.getMsg();
        this.timestamp = System.currentTimeMillis();
    }

    public ExceptionResult(Integer status, String message, Long timestamp) {
        this.status = status;
        this.message = message;
        this.timestamp = timestamp;
    }

}
